home *** CD-ROM | disk | FTP | other *** search
/ What CD? 12 / What PC June 1997.iso / multi / cyber / cyber95 / _setup.1 / HORN2.POP < prev    next >
Encoding:
Text File  |  1996-09-01  |  2.2 KB  |  84 lines

  1. // file : horn2.pop
  2. // this file describes a simple horn-form which uses egg-scaling to (hopefully),
  3. // allow for a variety of more elegant, (ie. "spindly"), forms than usual.
  4. // extends upon form1 by adding scaling of segments along the length of the spine.
  5. // as with form1, the results all look fairly straight, (ie. the spine twists around
  6. // its central axis but does not bend)
  7.  
  8.  
  9. /////////////////////////////////
  10. // population display settings //
  11. /////////////////////////////////
  12.  
  13. population 0
  14. dimensions = 1
  15. colour_model RGB
  16. render_quality flat
  17.  
  18.  
  19. ////////////
  20. // genome //
  21. ////////////
  22.  
  23. genome 0 {
  24.  
  25.     ////////////////
  26.     // initialise //
  27.     ////////////////
  28.  
  29.     // initialise scaling
  30.     eggScale( 1 : 0.5 : 1 ),   // allow smaller primitives than standard
  31.  
  32.     // initialise material properties
  33.     setColour( hsv<.5,.5,.75> : hsv<0,.2,.5> : hsv<.99999,.99999,.99999> ),
  34.     setTexture( norder false:toggle ),
  35.     setBitmap( norder 0 : 0 : 20 ),
  36.     *setWrap( norder 0 : 0 : 2 ),
  37.  
  38.     ///////////////
  39.     // horn loop //
  40.     ///////////////
  41.  
  42.     repeat( 1 : 1 : 60,   // #horn-segments
  43.         
  44.         // horn-segment code is made up of 2 distinct code blocks; the first block is executed
  45.         // within a new scope, called the "segment rib"; the second block is executed within
  46.         // the current scope and is called the "segment spine"
  47.         join(
  48.  
  49.             /////////
  50.             // rib //
  51.             /////////
  52.  
  53.             // in this horn the rib visually consists of a single primtive
  54.             *scope(
  55.                 // rotate so that rib does not point in same direction as the spine
  56.                 rotate( <0,0,0> : <-2,-2,-2> : <2,2,2> ),
  57.                 // move away from spine slightly
  58.                 forward( 0 : -2 : 2 ),
  59.                 // re-shape primitive
  60.                 eggVectorScale( <1,1,1> : <.75,.75,.75> : <1.25,1.25,1.25> ),
  61.                 // determine primitive type and lay an egg
  62.                 egg( 0 : 0 : 10 ),
  63.                 lay
  64.             ),
  65.  
  66.             ///////////
  67.             // spine //
  68.             ///////////
  69.  
  70.             // in this horn the spine has no visual form, but simply updates the turtle
  71.             // state ready for the next segment
  72.             forward( 0.3 : -1 : 1 ),
  73.             scale( 1.05 : 1.01 : 1.1 ),
  74.             bankLeft( dtor(10 : -25 : 25) ),
  75.             moveHue( 0.01 : 0.005 : 0.05 ),
  76.             scale( 1 : 0.9 : 1.1 )
  77.         )
  78.     )
  79. }
  80.  
  81.  
  82. // eof : horn2.pop
  83.  
  84.